# 问题引出
# 代码实现
hen1 = 3
hen2 = 5
hen3 = 1
hen4 = 3.4
hen5 = 2
hen6 = 50
# 计算总的体重
# total_weight = hen1 + hen2 + hen3 + hen4 + hen5 + hen6
# 计算平均体重
# avg_weight = total_weight / 6
# print(f"总体重:{total_weight} 平均体重:{round(avg_weight, 2)}")

# 使用列表解决
hens = [3, 5, 1, 3.4, 2, 50]
total_weight = 0
for index in range(len(hens)):
    total_weight += hens[index]
    print(f"第{index + 1}只鸡的重量:{hens[index]}kg")
    # index += 1

print(f"总体重:{total_weight} 平均体重:{round(total_weight / len(hens), 2)}")